import request from "@/utils/request.js"

/*
获取歌曲详情 --  /song/detail?ids=347230
  ids 歌曲id
获取相似音乐  /simi/song?id=347230
  id 歌曲id
歌曲评论  /comment/music?id=186016&limit=1
  id 歌曲id
  limit 取出评论数量 , 默认为 20
获取歌词  /lyric?id=33894312
  id 歌曲id
获取音乐url /song/url?id=33894312
  id 歌曲id
*/

export function songDetail(id) {
  return new Promise((reslove, reject) => {
    request({
      method: 'get',
      url: '/song/detail?ids= ' + id,
      success: (res) => {
        reslove(res)
      }
    })
    // success:(res)=>{
    //   console.log(res)
    // }
  })
}
export function songSimi(id) {
  return new Promise((reslove, reject) => {
    request({
      method: 'get',
      url: '/simi/song?id= ' + id,
      success: (res) => {
        reslove(res)
      }
    })
  })
}
export function songComment(id, limit) {
  return new Promise((reslove, reject) => {
    request({
      method: 'get',
      url: '/comment/music?id=' + id + '&limit=' + limit,
      success: (res) => {
        reslove(res)
      }
    })
  })
}
export function songLyric(id) {
  return new Promise((reslove, reject) => {
    request({
      method: 'get',
      url: '/lyric?id=' + id,
      success: (res) => {
        reslove(res)
      }
    })
  })
}
export function songUrl(id) {
  return new Promise((reslove, reject) => {
    request({
      method: 'get',
      url: '/song/url?id=' + id,
      success: (res) => {
        reslove(res)
      }
    })
  })
}
